<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .content-wrapper {
            margin-top: 150px;
            margin-left: 500px;

            /*  padding: 20px;
              background: orange;
              color: #fff;
              position: absolute;
              top: 50%;
              left: 50%;
              border-radius: 5px;
              -webkit-transform: translate(-50%, -50%);
              -moz-transform: translate(-50%, -50%);
              transform: translate(-50%, -50%);*/
        }

        #roomimg {
            float: left;
        }

        #room {
            margin-top: 30px;
            margin-left: 100px;
            float: left;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-control {
            padding-left: 5px;
        }

        #inputPassword3 {
            width: 148px;
        }
    </style>
    <%-- <script>
         function ifButt() {

             var roomNumber = $("#inputEmail3").val();    // 获取id为username的<input>框数据

             // Ajax提交数据
             $.ajax({
                 url: "admin/check_login",    // 提交到controller的url路径
                 type: "post",    // 提交方式
                 data: {"roomNumber": roomNumber},  // data为String类型，必须为 Key/Value 格式。
                 dataType: "json",    // 服务器端返回的数据类型
                 success: function (data) {    // 请求成功后的回调函数，其中的参数data为controller返回的map,也就是说,@ResponseBody将返回的map转化为JSON格式的数据，然后通过data这个参数取JSON数据中的值
                     if (data.roomNumber == roomNumber) {
                         //跳转到系统首页
                         alert("用户已存在");
                     }
                 },
             });
         }

     </script>--%>

    <script>
        function buttn() {
            $("from1").submit();
        }
    </script>
</head>
<body>
<div>
    <!-- 内容区域 -->
    <div class="content-wrapper">
        <!-- 内容头部 -->

        <div id="roomimg">
            <img src="${pageContext.request.contextPath}/images/danren.jpg">
        </div>
        <div id="room">
            <h3>添加房间</h3><br/>
            <%--跳转到controller里面--%>
            <form id="from1" class="form-horizontal"
                  action="${pageContext.request.contextPath}/room/update" method="post">
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">房号:</label>
                    <input type="text" name="roomNumber" class="form-control" id="inputEmail3" value="${pageContext.request.getParameter("rid")}">
                </div>
                <div class="form-group">
                    <!--<label for="inputPassword3" class="col-sm-2 control-label">类型:</label>
                    <input type="password" class="form-control" id="inputPassword3" placeholder="请规定房型">-->
                    <option>--请选择住房类型--</option>
                    <label for="inputPassword3" class="col-sm-2 control-label">类型:</label>
                    <select id="inputPassword3" name="roomType">
                        <option value="大床房">大床房</option>
                        <option value="双人床">双人床</option>
                        <option value="单人床">单人房</option>
                        <option value="钟点房">钟点房</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="inputEmail4" class="col-sm-2 control-label">定价:</label>
                    <input type="text" name="roomPrice" class="form-control" id="inputEmail4" placeholder="请填写定价">
                </div>

                <div class="form-group">
                    <label for="inputEmail5" class="col-sm-2 control-label">描述:</label>
                    <input type="text" name="roomDescribe" class="form-control" id="inputEmail5" placeholder="请填写描述">
                </div>

                <div class="form-group" id="buttnOne">
                    <div class="col-sm-offset-2 col-sm-10">
                        <!--<button type="submit" class="btn btn-default">提交</button>-->
                        <input class="btn btn-default" type="submit" onclick="" value="提交">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>